FROM python:3.12-alpine
COPY requirements.txt ./
RUN pip config set global.cache-dir "/data/pip-cache"
RUN pip install --upgrade pip -i https://pypi.tuna.tsinghua.edu.cn/simple || pip install --upgrade pip 
# install required packages
RUN pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple || pip install -r requirements.txt
# set timezone
RUN cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' >/etc/timezone
COPY . /home
WORKDIR /home
EXPOSE 8000
CMD ["python", "manage.py", "runserver", "0.0.0.0:8000"]